PGetPageImage

Gets the image of the current page or selected items. Returns a bitmap image in Windows and a PICT image on the Macintosh.


Query constructor

PGetPageImage(PMBool bSelect, short cViewPercentage, short nRefNumber, short nPictID, long hDC);
PMBool bSelect;
false for entire page
true for only selected items
short cViewPercent;
25 for 25%
50 for 50%
75 for 75%
100 for 100%
200 for 200%
400 for 400%
-3 for fit in window
-4 for entire pasteboard
short nRefNumber;
File reference number for Macintosh
-2 for Windows
short nPictID;
Resource ID for Macintosh
-2 for Windows
long hDC;
Windows handle to device context
-2 for Macintosh


Query results

long hImage;
Macintosh only. Handle to PICT image (returned only if nRefNumber is -1)
Facing pages. In double-sided, facing-pages mode, PageMaker returns a single image of both pages.

bSelect. If bSelect is true, PageMaker returns an image of only the selected objects on the page (not the entire page).

cViewPercentage. Only PageMaker for the Macintosh uses the cViewPercentage parameter. Although PageMaker for Windows disregards the value of the parameter, the parameter is required. (See "hDC" below.)

hDC. In Windows, the GetPageImage query requires a handle to the Device Context (hDC). The hDC must declare a bitmap with the desired rectangular coordinates. PageMaker for Windows maps the page image into the specified bitmap, scaling the page as necessary. The size of this image depends on the size of the bitmap, not the value specified by cViewPercentage.

nRefNumber. On the Macintosh, nRefNumber is the file reference number. PageMaker will use the Macintosh toolbox routine AddResource to draw the page image into this resource file, using PICT as the resource type and nPictID as the resource ID. If nRefNumber is -1, PageMaker returns hImage. Your plug-in is responsible for deleting the PICT resource.

Memory. You may run out of memory when working with complex or multiple pages in low-memory situations. To help avoid this problem, delete the memory used for one page-image handle before getting the next page image.

Also note that pages containing large or complex graphics may cause problems in low-memory situations. Whenever possible, we recommend that you change the PageMaker preference for graphic display to a gray box or to normal resolution before using PGetPageImage.


See also

The PGetPreferences query

The PPreferences command


Copyright © 1996, Adobe Systems Incorporated. All rights reserved.

Comments or suggestions? Contact Adobe Developer Support